//
//  BMSInitializer.h
//  WDBMS
//
//  Created by YeJary on 2025/5/13.
//

#import <Foundation/Foundation.h>
#import "BMSLaunchConfigModel.h"
#import "BMSOfficialHolidayModel.h"
#import "BMSIPBlockStatusModel.h"
#import "BMSLoginResponseModel.h"
#import "BMSAntiAddictionManager.h"
#import "BMSUserSourceModel.h"

NS_ASSUME_NONNULL_BEGIN

@interface BMSInitializer : NSObject

@property (nonatomic, assign, readonly) BOOL didAgreePrivacy;
@property (nonatomic, assign, readonly) BOOL didRealnameAuth;
@property (nonatomic, assign) BOOL isTeenager;
@property (nonatomic, assign, readonly) BOOL idfaAuthorized;

@property (nonatomic, assign, readonly) BOOL shouldShowAntiAddictionTip;
@property (nonatomic, assign, readonly) BOOL shouldForceLogout;
@property (nonatomic, strong, readonly) NSArray<NSString *> *holidayList;
@property (nonatomic, strong, readonly) NSDate *serverNowDate;

@property (nonatomic, assign) BOOL hasShownForcedRealnamePopup;  // 强制实名是否已弹出过

@property (nonatomic,strong, readonly) BMSLoginResponseModel *loginModel;

@property (nonatomic,strong, readonly) BMSLaunchConfigModel *launchModel;

@property (nonatomic, copy) NSString *channel;

@property (nonatomic, copy) NSString *version;

@property (nonatomic, copy) NSString *appName;

@property (nonatomic, copy, readonly) NSString *uuid;

/// 是否已允许初始化第三方 SDK
@property (nonatomic, assign, readonly) BOOL canInitializeSDKs;

/// 初始化完成回调（供外部监听）
@property (nonatomic, copy, nullable) void (^onInitCompletion)(BOOL privacyAgreed, BOOL trackingAuthorized);

+ (instancetype)shared;

+ (void)startWithAppName:(NSString *)appName
                 version:(NSString *)version
                 channel:(NSString *)channel
              completion:(void(^)(void))completion;

- (void)markPrivacyAgreed;
- (void)markRealnameVerified:(BOOL)isTeenager;
- (void)evaluateAntiAddictionPolicy;

/// 处理用户已同意隐私后的登录流程（IDFA & 登录）
- (void)handlePrivacyAgreedAndLoginWithCompletion:(void(^)(BOOL loginSuccess))completion;

- (void)saveTeenagerStatusToPersistentStorage:(BOOL)isTeenager;

@end

NS_ASSUME_NONNULL_END
